﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace DB_NH.DB_Map.ywxt.ProjectBZJ
{
    using NHibernate;
    using NHibernate.Mapping.ByCode;
    using NHibernate.Mapping.ByCode.Conformist;

    using DB_NH.DB_Model.ywxt.ProjectBZJ;

    public class TuiBao_SQ_Map : EntityMapping<TuiBao_SQ>
    {
        public TuiBao_SQ_Map()
        {
            Property(x => x.SQTitle, map =>
            {
                map.Length(1000000);
            });

            Property(x => x.ApprovalRecordId, map =>
            {
                map.Length(40);
            });

            ManyToOne(x => x.OpUser, map =>
            {
                map.Column("UserID");
            });

            Bag(x => x.details, map =>
            {
                map.Key(keyMapper => keyMapper.Column("SqId"));
                map.Cascade(Cascade.None);
            }, rel => rel.OneToMany());

            Table("TuiBao_SQ");
        }
    }
}
